<?php
	require_once($_SERVER['DOCUMENT_ROOT'].'uno-course-scheduler/include/config.inc.php');
	require_once($_SERVER['DOCUMENT_ROOT'].'uno-course-scheduler/include/top.inc.php');

$building_id = $_GET['bid'];
$timeslot_id = $_GET['id'];

$get_building_data = mysql_query("SELECT * FROM buildings WHERE id = $building_id");
$building_name = mysql_result($get_building_data,0,'building_name');
$abbreviation = mysql_result($get_building_data,0,'abbreviation');


echo "<h1>Delete Timeslot in $building_name</h1>";

$query = "DELETE FROM time_slots WHERE id='$timeslot_id'";
$result = mysql_query($query);

if ($result)
{
	echo "Timeslot has been successfully deleted!";
	echo "<br />";
}
else
{
	echo "Timeslot was NOT able to be deleted at this time!";
	echo "<br />";
}

//close
mysql_close();

echo "<p>";
	echo "<a href='timeslots.php?id=$building_id'>&lt;&lt; Back to Timeslots Portal</a><br />";
echo "</p>";
?>

<?php
	require_once($_SERVER['DOCUMENT_ROOT'].'uno-course-scheduler/include/bottom.inc.php');
?>